export const formatTime = (timestamp: any) => {
  const dateString = timestamp;

  // 创建一个新的Date对象，传入日期字符串作为参数
  const dateObject = new Date(dateString);

  // 使用Date对象的方法获取各个时间组件
  const year = dateObject.getFullYear();
  const month = dateObject.getMonth() + 1; // 月份是从0开始的，所以要加1
  const day = dateObject.getDate();
  const hours = dateObject.getHours();
  const minutes = dateObject.getMinutes();
  const seconds = dateObject.getSeconds();

  // 格式化输出
  const formattedDate = `${year}-${month < 10 ? '0' + month : month}-${day < 10 ? '0' + day : day} ${hours < 10 ? '0' + hours : hours}:${minutes < 10 ? '0' + minutes : minutes}:${seconds < 10 ? '0' + seconds : seconds}`;

  return formattedDate
}